package com.easyj.base.exception;

/**
 *  统一错误处理，所有exception都extends此
 * @author hjf
 *
 */
public class EasyjException extends Exception{
	private static final long serialVersionUID = -125826905564437368L;
	
	public static final int UpdateSystemObject=10000; //更新系统定义对象错误
	public static final int DeleteUsedObject=10001;  //试图删除使用的对象
	public static final int CANNOTDELETE=10002;      //不可删除 
	public static final int UpdateError=10003;
	public static final int DataError=10004;
	public static final int OverMaxLimit=10009;     //超出一次读取最大的数量值
	
	public static final int ParamUnInited =19999;     //参数未设置
	
	public static final int FileStoreError=11000; //保存文件错误
	public static final int MkDirError=11001;  //建立目录错误
	public static final int OverMaxSize=11002;  //超出最大文件限制 
	public static final int FileTypeError=11003;  //文件类型错误
	public static final int HandleImageError=12000; 
	
	public static final int InValidParam = 20000;  //校验数据错误
	public static final int  SameCode = 20001;     //有相同的代码
	public static final int  SameName = 20002;
	public static final int  SameMobile = 20003;
	
	public static final int  InValidRegion = 30001;  //没有该仓库权限
	public static final int  InValidDepartment = 30002;  //没有该部门权限
	
	public static final int InvalidData=99998;
	public static final int UnDefine=99999;           //未定义错误，简单错误
	
	public static final int Transactional= 90000;    //事务错误
	
	public static final int ActivitiError = 50000;  //流程数据错误
	
    private int code;
	
	public  EasyjException(int code,String message){
		super(message);
		this.code=code;
	}
	
	public EasyjException(int code,String message, Throwable cause) {
		super(message,cause);
		this.code=code;
		
	}

	public int getCode() {
		return code;
	}
	
	
}
